<% include header %>
    <div class="row">
        <a class="btn btn-success" href="/additem" role="button">新增一个商品</a>
    </div>

    <table class="table table-hover">
        <thead>
            <td>序号</td>
            <td>编号</td>
            <td>名称</td>
            <td>价格</td>
            <td>PV</td>
            <td>标签</td>
            <td>图片</td>
            <td>操作</td>
        </thead>
        <tbody>
            <% items.forEach(function (item, index) { %>
                <tr>
                    <td><%= index+1 %></td>
                    <td><a href="/item/<%= item._id %>" target="_blank"><%= item._id %></a></td>
                    <td><%= item.name %></td>
                    <td><%= item.price %></td>
                    <td><%= item.pv %></td>
                    <td><%= item.tags %></td>
                    <td><%= item.imgpath %></td>
                    <td>
                        <a class="btn btn-primary" href="/edititem/<%= item._id %>" role="button">编辑</a>
                        <a class="btn btn-danger" href="/deleteitem/<%= item._id %>" role="button">删除</a>
                    </td>
                </tr>
            <% }) %>
        </tbody>
    </table>

<%- include paging %>
<%- include footer %>